home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / AppleScript.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  5.8 KB  |  201 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleScript.p
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT AppleScript;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __APPLESCRIPT__}
  30. {$SETC __APPLESCRIPT__ := 1}
  31.  
  32. {$I+}
  33. {$SETC AppleScriptIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __ERRORS__}
  38. {$I Errors.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __APPLEEVENTS__}
  43. {$I AppleEvents.p}
  44. {$ENDC}
  45. {    Types.p                                                        }
  46. {    Memory.p                                                    }
  47. {        MixedMode.p                                                }
  48. {    OSUtils.p                                                    }
  49. {    Events.p                                                    }
  50. {        Quickdraw.p                                                }
  51. {            QuickdrawText.p                                        }
  52. {    EPPC.p                                                        }
  53. {        AppleTalk.p                                                }
  54. {        Files.p                                                    }
  55. {            Finder.p                                            }
  56. {        PPCToolbox.p                                            }
  57. {        Processes.p                                                }
  58. {    Notification.p                                                }
  59.  
  60. {$IFC UNDEFINED __OSA__}
  61. {$I OSA.p}
  62. {$ENDC}
  63. {    AEObjects.p                                                    }
  64. {    Components.p                                                }
  65.  
  66. {$IFC UNDEFINED __TEXTEDIT__}
  67. {$I TextEdit.p}
  68. {$ENDC}
  69.  
  70. {$PUSH}
  71. {$ALIGN MAC68K}
  72. {$LibExport+}
  73.  
  74. CONST
  75.     typeAppleScript                = 'ascr';
  76.     kAppleScriptSubtype            = typeAppleScript;
  77.     typeASStorage                = typeAppleScript;
  78.  
  79. {*************************************************************************
  80.     Component Selectors
  81. *************************************************************************}
  82.     kASSelectInit                = $1001;
  83.     kASSelectSetSourceStyles    = $1002;
  84.     kASSelectGetSourceStyles    = $1003;
  85.     kASSelectGetSourceStyleNames = $1004;
  86.  
  87. {*************************************************************************
  88.     OSAGetScriptInfo Selectors
  89. *************************************************************************}
  90.     kASHasOpenHandler            = 'hsod';
  91.  
  92. {
  93.         This selector is used to query a context as to whether it contains
  94.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  95.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  96.         there is no kAEOpenDocuments handler, and returns the error value 
  97.         errOSAInvalidAccess if the input is not a context.
  98.     }
  99. {*************************************************************************
  100.     Initialization
  101. *************************************************************************}
  102.  
  103. FUNCTION ASInit(scriptingComponent: ComponentInstance; modeFlags: LONGINT; minStackSize: LONGINT; preferredStackSize: LONGINT; maxStackSize: LONGINT; minHeapSize: LONGINT; preferredHeapSize: LONGINT; maxHeapSize: LONGINT): OSAError;
  104.     {$IFC NOT GENERATINGCFM}
  105.     INLINE $2F3C, $1C, $1001, $7000, $A82A;
  106.     {$ENDC}
  107. {
  108.         ComponentCallNow(kASSelectInit, 28);
  109.         This call can be used to explicitly initialize AppleScript.  If it is
  110.         not called, the a scripting size resource is looked for and used. If
  111.         there is no scripting size resource, then the constants listed below
  112.         are used.  If at any stage (the init call, the size resource, the 
  113.         defaults) any of these parameters are zero, then parameters from the
  114.         next stage are used.  ModeFlags are not currently used.
  115.         Errors:
  116.         errOSASystemError        initialization failed
  117.     }
  118. {
  119.     These values will be used if ASInit is not called explicitly, or if any
  120.     of ASInit's parameters are zero:
  121. }
  122.  
  123. CONST
  124.     kASDefaultMinStackSize        = 4 * 1024;
  125.     kASDefaultPreferredStackSize = 16 * 1024;
  126.     kASDefaultMaxStackSize        = 16 * 1024;
  127.     kASDefaultMinHeapSize        = 4 * 1024;
  128.     kASDefaultPreferredHeapSize    = 16 * 1024;
  129.     kASDefaultMaxHeapSize        = 32 * 1024 * 1024;
  130.  
  131. {*************************************************************************
  132.     Source Styles
  133. *************************************************************************}
  134.  
  135. FUNCTION ASSetSourceStyles(scriptingComponent: ComponentInstance; sourceStyles: STHandle): OSAError;
  136.     {$IFC NOT GENERATINGCFM}
  137.     INLINE $2F3C, $4, $1002, $7000, $A82A;
  138.     {$ENDC}
  139. {
  140.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  141.         Errors:
  142.         errOSASystemError        operation failed
  143.     }
  144. FUNCTION ASGetSourceStyles(scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
  145.     {$IFC NOT GENERATINGCFM}
  146.     INLINE $2F3C, $4, $1003, $7000, $A82A;
  147.     {$ENDC}
  148. {
  149.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  150.         Errors:
  151.         errOSASystemError        operation failed
  152.     }
  153. FUNCTION ASGetSourceStyleNames(scriptingComponent: ComponentInstance; modeFlags: LONGINT; VAR resultingSourceStyleNamesList: AEDescList): OSAError;
  154.     {$IFC NOT GENERATINGCFM}
  155.     INLINE $2F3C, $8, $1004, $7000, $A82A;
  156.     {$ENDC}
  157. {
  158.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  159.         This call returns an AEList of styled text descriptors the names of the
  160.         source styles in the current dialect.  The order of the names corresponds
  161.         to the order of the source style constants, below.  The style of each
  162.         name is the same as the styles returned by ASGetSourceStyles.
  163.         
  164.         Errors:
  165.         errOSASystemError        operation failed
  166.     }
  167. {
  168.     Elements of STHandle correspond to following categories of tokens, and
  169.     accessed through following index constants:
  170. }
  171.  
  172. CONST
  173.     kASSourceStyleUncompiledText = 0;
  174.     kASSourceStyleNormalText    = 1;
  175.     kASSourceStyleLanguageKeyword = 2;
  176.     kASSourceStyleApplicationKeyword = 3;
  177.     kASSourceStyleComment        = 4;
  178.     kASSourceStyleLiteral        = 5;
  179.     kASSourceStyleUserSymbol    = 6;
  180.     kASSourceStyleObjectSpecifier = 7;
  181.     kASNumberOfSourceStyles        = 8;
  182.  
  183. { Gestalt selectors for AppleScript }
  184.     gestaltAppleScriptAttr        = 'ascr';
  185.     gestaltAppleScriptVersion    = 'ascv';
  186.  
  187.     gestaltAppleScriptPresent    = 0;
  188.     gestaltAppleScriptPowerPCSupport = 1;
  189.  
  190.  
  191. {$ALIGN RESET}
  192. {$POP}
  193.  
  194. {$SETC UsingIncludes := AppleScriptIncludes}
  195.  
  196. {$ENDC} {__APPLESCRIPT__}
  197.  
  198. {$IFC NOT UsingIncludes}
  199.  END.
  200. {$ENDC}
  201.